<%-- 
  - Author: Mohtisham Anwar
  - Date: 03-Apr-2011
  - Copyright Notice: TRAKHEES
  - Description: show.jsp
 --%>

<%@page import="java.util.List"%>
<%@page import="java.util.Collections"%>
<%@page import="java.util.Arrays"%>
<%@page import="ae.pcfc.etks.online.common.exception.SystemException"%>
<%@ include file="/WEB-INF/view/include.jsp"%>
<%@ page import="ae.pcfc.etks.online.web.*"%>
<%@ page isErrorPage="true" %>
<link
	href='<c:url value="/resources/styles/redmond/jquery-ui-1.8.10.custom.css"/>'
	rel="stylesheet" type="text/css" />


<div id="container" dir='<spring:message code="page.dir"/>'
	align='<spring:message code="page.align"/>'>
	<fieldset><legend> <spring:message code="label.error"/></legend>
	</fieldset>
	<div class="ui-state-error">
			<c:choose>
			<c:when test="${not empty exception}">
				<%
					if(exception instanceof SystemException){
						String messageKey = ViewUtils.getExceptionErrorMessageKey((SystemException)exception);
						if(messageKey != null){
							pageContext.setAttribute("messageKey",messageKey);
							SystemException sytemException = (SystemException)exception;
							List<String> argsList = sytemException.getErrorMessageArgList();
							if(argsList != null && argsList.size() > 0 ){
								pageContext.setAttribute("args",argsList.toArray(new String[argsList.size()]));
							}
							
				%>
				<spring:message code="${messageKey}" arguments="${args}"
				 argumentSeparator=","></spring:message>
				 <%
						}
					}
				 %>
			</c:when>
			<c:otherwise>
				<spring:message code="error.unhandled.exception"/>
			</c:otherwise>
		</c:choose>
	</div>	
</div>